#include "box.h"
#include "ui_box.h"

void box::init_1st(){
    sDisplay="第一关";
    round=0;
    QRect rect(400,160,40,40);
    manrect=rect;

    QRect rect0(200,240,40,40);
    boxrect[0]=rect0;
    QRect rect1(320,240,40,40);
    boxrect[1]=rect1;
    QRect rect2(360,200,40,40);
    boxrect[2]=rect2;
    QRect rect3(240,280,40,40);
    boxrect[3]=rect3;
    QRect rect4(240,320,40,40);
    boxrect[4]=rect4;

    QRect rec0(120,360,40,40);
    holes[0]=rec0;
    QRect rec1(160,360,40,40);
    holes[1]=rec1;
    QRect rec2(200,360,40,40);
    holes[2]=rec2;
    QRect rec3(240,360,40,40);
    holes[3]=rec3;
    QRect rec4(280,360,40,40);
    holes[4]=rec4;

    for(int i=0;i<9;i++){
        QRect rect(80+40*i,400,40,40);
        wall[i]=rect;
    }
    for(int i=0;i<7;i++){
        QRect rect(200+40*i,120,40,40);
        wall[9+i]=rect;
    }
    for(int i=0;i<5;i++){
        QRect rect(440,160+40*i,40,40);
        wall[16+i]=rect;
    }
    for(int i=0;i<5;i++){
        QRect rect(160,160+40*i,40,40);
        wall[21+i]=rect;
    }
    for(int i=0;i<2;i++){
        QRect rect(320,160+40*i,40,40);
        wall[26+i]=rect;
    }
    for(int i=0;i<2;i++){
        QRect rect(320,280+40*i,40,40);
        wall[28+i]=rect;
    }
    for(int i=0;i<2;i++){
        QRect rect(400,320+40*i,40,40);
        wall[30+i]=rect;
    }
    QRect recta(200,160,40,40);
    wall[32]=recta;
    QRect rectb(280,280,40,40);
    wall[33]=rectb;
    QRect rectc(80,320,40,40);
    wall[34]=rectc;
    QRect rectd(80,360,40,40);
    wall[35]=rectd;
    QRect recte(120,320,40,40);
    wall[36]=recte;
}

void box::init_2nd(){
    sDisplay="第二关";
    round=0;
    QRect rect(200,320,40,40);
    manrect=rect;

    QRect rect0(160,200,40,40);
    boxrect[0]=rect0;
    QRect rect1(200,200,40,40);
    boxrect[1]=rect1;
    QRect rect2(240,200,40,40);
    boxrect[2]=rect2;
    QRect rect3(320,280,40,40);
    boxrect[3]=rect3;
    QRect rect4(480,480,1,1);
    boxrect[4]=rect4;

    QRect rec0(240,240,40,40);
    holes[0]=rec0;
    QRect rec1(240,280,40,40);
    holes[1]=rec1;
    QRect rec2(280,240,40,40);
    holes[2]=rec2;
    QRect rec3(280,280,40,40);
    holes[3]=rec3;
    holes[4]=boxrect[4];

    for(int i=0;i<8;i++){
        QRect rect(120+40*i,360,40,40);
        wall[i]=rect;
    }
    for(int i=0;i<5;i++){
        QRect rect(80,120+40*i,40,40);
        wall[i+8]=rect;
    }
    for(int i=0;i<5;i++){
        QRect rect(120+40*i,120,40,40);
        wall[i+13]=rect;
    }
    for(int i=0;i<3;i++){
        QRect rect(320+40*i,240,40,40);
        wall[i+18]=rect;
    }
    QRect recta(120,280,40,40);
    wall[21]=recta;
    QRect rectb(120,320,40,40);
    wall[22]=rectb;
    QRect rectc(280,160,40,40);
    wall[23]=rectc;
    QRect rectd(280,200,40,40);
    wall[24]=rectd;
    QRect recte(400,280,40,40);
    wall[25]=recte;
    QRect rectf(400,320,40,40);
    wall[26]=rectf;
    QRect rectg(320,200,40,40);
    wall[27]=rectg;
    QRect recth(200,240,40,40);
    wall[28]=recth;
    for(int i=29;i<37;i++){
        QRect rr(0,0,1,1);
        wall[i]=rr;
    }
};
